package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserZodiacForeign;
import com.culturalCenter.dataCenter.mapper.user.UserZodiacForeignMapper;
import com.culturalCenter.dataCenter.service.user.UserZodiacForeignService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserZodiacForeign业务层接口实现类
 * @Date
 *****/
@Service
public class UserZodiacForeignServiceImpl implements UserZodiacForeignService {

    @Resource
    private UserZodiacForeignMapper userZodiacForeignMapper;

    @Override
    public PageInfo<UserZodiacForeign> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userZodiacForeignMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userZodiacForeignMapper.deleteById(id);
    }

    @Override
    public Integer update(UserZodiacForeign userZodiacForeign) {
        return userZodiacForeignMapper.update(userZodiacForeign);
    }

    @Override
    public Integer add(UserZodiacForeign userZodiacForeign) {
        return userZodiacForeignMapper.insert(userZodiacForeign);
    }

    @Override
    public UserZodiacForeign findById(String id) {
        return userZodiacForeignMapper.queryById(id);
    }

    @Override
    public List<UserZodiacForeign> findAll(UserZodiacForeign userZodiacForeign) {
        return (List<UserZodiacForeign>) userZodiacForeignMapper.queryAll(userZodiacForeign);
    }

}
